
<template>
  <button @click="d2c">Hello</button>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { sendMsgToPlugin, UIMessage } from '@messages/sender'


const test = ref('')

function d2c() {
  sendMsgToPlugin({
    type: UIMessage.D2C,
    data: 'hello'
  })
  //接收插件的消息
  window.onmessage = (event) => {
    console.log(event.data)
  }
}
</script>
